import { setCookie } from '@/utils/auth'
import { IPermissionState } from './state'

export const mutations = {
  SET_MENUPERMISSION: (state: IPermissionState, menuPermission: any) => {
    state.menuPermission = menuPermission
    setCookie('menuPermission', JSON.stringify(menuPermission))
  },
  SET_BUTTONPERMISSION: (state: IPermissionState, buttonPermission: any) => {
    state.buttonPermission = buttonPermission
    setCookie('buttonPermission', JSON.stringify(buttonPermission))
  }
}
